<admintpl file="header"/>
<body class="J_scroll_fixed">
<div class="wrap J_check_wrap">
  <ul class="nav nav-tabs">
     <li class="active"><a href="{:U('plugin/index')}">所有插件</a></li>
     <!-- <li><a href="{:U('plugin/add')}">创建插件</a></li> -->
  </ul>
  <div class="common-form">
    <form method="post" class="J_ajaxForm" action="#">
      <div class="table_list">
      	<php>
        		$status=array("1"=>"启用","0"=>"禁用","3"=>'未安装');
        </php>
	    <table width="100%" class="table table-hover">
	        <thead>
	          <tr>
	            <th>名称</th>
	            <th>标识</th>
	            <th>钩子</th>
	            <th>描述</th>
	            <th>作者</th>
	            <th width="45">状态</th>
	            <th width="150">操作</th>
	          </tr>
	        </thead>
	        <tbody>
	        	<foreach name="plugins" item="vo">
	        	<tr>
		            <td>{$vo.title}</td>
		            <td>{$vo.name}</td>
		            <td>{$vo.hooks}</td>
		            <td>{$vo.description}</td>
		            <td>{$vo.author}</td>
		            <td>{$status[$vo['status']]}</td>
		            <td>
		            <if condition="$vo['status']==3">
		            	<a href="{:U('plugin/install',array('name'=>$vo['name']))}" class="J_ajax_dialog_btn"  data-msg="确定安装该插件吗？">安装</a>
		            <else/>
		            	<php>$config=json_decode($vo['config'],true);</php>
	            		<if condition="!empty($config)">
	            			<a href="{:U('plugin/setting',array('id'=>$vo['id']))}">设置</a>|
	            		<else/>
	            			<a href="javascript:;" style="color:#ccc;">设置</a>|
	            		</if>
	            		
	            		<if condition="!empty($vo['has_admin'])">
	            			<a href="javascript:parent.openapp('{:sp_plugin_url($vo['name'].'://AdminIndex/index')}','plugin_{$vo.name}','{$vo.title}')">管理</a>|
	            		<else/>
	            			<a href="javascript:;" style="color:#ccc;">管理</a>|
	            		</if>
	            		
	            		<a href="{:U('plugin/update',array('name'=>$vo['name']))}" class="J_ajax_dialog_btn"  data-msg="确定更新该插件吗？">更新</a>|
		            	<if condition="$vo['status']==0">
		            		<a href="{:U('plugin/toggle',array('id'=>$vo['id'],'enable'=>1))}" class="J_ajax_dialog_btn"  data-msg="确定启用该插件吗？">启用</a>|
		            	<else/>
		            		<a href="{:U('plugin/toggle',array('id'=>$vo['id'],'disable'=>1))}" class="J_ajax_dialog_btn"  data-msg="确定禁用该插件吗？">禁用</a>|
		            	</if>
	            		<a href="{:U('plugin/uninstall',array('id'=>$vo['id']))}" class="J_ajax_dialog_btn"  data-msg="确定卸载该插件吗？">卸载</a>
		            </if>
		            	
			        </td>
	          	</tr>
	          	</foreach>
			</tbody>
	      </table>
  		</div>
    </form>
  </div>
</div>
<script src="__ROOT__/statics/js/common.js?"></script>
</body>
</html>